def gdn(m,x,n):
    if(x>=2):
        result=gdn(m,x-1,m)
        for i in range(1,n-1):
            result = gdn(m,x-1, result)
        return result
    return m**n

print(gdn(3,3,3)) #这个数宇宙装不下